home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
graphics
/
amicad
/
arexx_english
/
editscript.amicad
< prev
next >
Wrap
Text File
|
1999-12-06
|
2KB
|
54 lines
/* EditScript.AmiCAD, Version 1.00e © R.Florac */
/* This script is called for loading a script file in a text editor while working with AmiCAD */
/* Push the CONTROL key while selecting an ARexx menu with AmiCAD
* to call it. The script must be in the AmiCAD/ARexx directory and
* must have the .AmiCAD extension to his name.
* This script is for my text editor Amitex, adapt it
* to any other text editor to suit to your needs.
$VER: 1.1 (© R.Florac, 22/5/99) */
signal on error /* for intercepting the errors */
signal on syntax
options results
parse arg script /* reads the script name */
if script = "" then do
'REQFILE("Script file to edit", "Work:AmiCAD/ARexx", "")'
script = result
if script="" then exit
end
port = ADDRESS() /* reads the name of AmiCAD ARexx port */
address command
if ~show(p, "AMITEX") then do /* could be better (AMITEX0, AMITEX1...) */
f=0 /* No window allready opened */
'run > nil:' "c:AmiTex" /* loading the editor */
waitforport "AMITEX"
end
else f=1 /* the editor was allready running */
ADDRESS (AMITEX)
cr='0a'x
if f=1 then 'NEW("")' /* ask for opening a new window */
if ~exists(script) then script=script||".AmiCAD"
'LOAD("'script'")' /* loads the script file */
exit
/* Traitement des erreurs, interruption du programme */
syntax:
address (port)
erreur=RC
'MESSAGE("Script EditScript.AmiCAD :"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
exit
error:
address (port)
'MESSAGE("Script EditScript.AmiCAD :"+CHR(10)+"Error in line 'SIGL'")'
exit